package com.kingwang.training.designpattern.templatemethod;

import com.kingwang.training.designpattern.templatemethod.bo.BankService;
import com.kingwang.training.designpattern.templatemethod.bo.DepositService;
import com.kingwang.training.designpattern.templatemethod.bo.TransferService;
import org.springframework.boot.ApplicationArguments;
import org.springframework.boot.ApplicationRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

@SpringBootApplication
public class TemplateMethodApplication implements ApplicationRunner {

    public static void main(String[] args) {
        SpringApplication.run(TemplateMethodApplication.class, args);
    }

    @Override
    public void run(ApplicationArguments args) throws Exception {
        BankService depositService = new DepositService();
        depositService.service();

        BankService transferService = new TransferService();
        transferService.service();
    }
}
